<template>
 <div>
    <h1>用户列表</h1>
    <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="id" label="编号" width="180" />
    <el-table-column prop="username" label="角色名称" width="180" />
    <!-- <el-table-column  label="角色权限" >
       <template #default="scope">
      <el-tree
    style="max-width: 600px"
    :data="scope.row.tree"
    :props="defaultProps"
    @node-click="handleNodeClick"
  />
  </template>
    </el-table-column> -->
    <el-table-column label="Operations">
      <template #default="scope">
        <el-button size="small" @click="handleEdit(scope.$index, scope.row)">
          Edit
        </el-button>
        <el-button
          size="small"
          type="danger"
          @click="handleDelete(scope.$index, scope.row)"
        >
          Delete
        </el-button>
      </template>
    </el-table-column>
  </el-table>
  </div>
</template>

<script setup lang="ts">
import {getulist} from '../../request/index'
import {ref} from 'vue'

const tableData=ref([])
getulist().then(res=>{
  console.log('role',res)
  tableData.value=res.data.data
})
const defaultProps = {
  children: 'children',
  label: 'label',
}


</script>

<style>

</style>